package com.heima.user.controller.v1;


import com.heima.model.common.dtos.ResponseResult;
import com.heima.user.service.ApUserImportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

@Api(value = "批量注册功能API",tags = "批量注册功能API")
@RestController
@RequestMapping("/api/v1/apex")
public class ApUserImportController {

    @Autowired
    ApUserImportService apUserImportService;

    @ApiOperation(value = "批量注册")
    @PostMapping("/import")
    public ResponseResult importUser(MultipartFile file) {
        return apUserImportService.importUser(file);
    }

    @ApiOperation(value = "批量下载重复手机号用户")
    @GetMapping("/export")
    public void dowmUsers(HttpServletResponse response,
                                    @RequestParam(value = "repetitionId") String repetitionId) {
        apUserImportService.dowmUsers(response,repetitionId);
    }
}
